package com.education.springbootdemo.mail;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service("EmailServiceImpl")
public class EmailServiceImpl implements EmailService {

    @Autowired
    private MyEmail myEmail;

    @Resource(name = "EmailConfig")
    private EmailConfig config;

    @Override
    public boolean sendEmail(String to, String subject, String body) {
        boolean success = EmailUtils.sendEmail(myEmail,to,subject,body);
        return success;
    }
}
